<style>
	.page-content {
    float: left;
	width: 100%;
}
</style>
<div class="single-head">
	<h3 class="pull-left"><i class="fa fa-desktop purple"></i> <?php echo Rights::t('core', 'Assignments for :username', array(
		':username'=>$model->getName()
	)); ?></h3>
	<div class="breads pull-right">
		<strong>Nav</strong> : <a href="<?php echo Yii::app()->createUrl('User'); ?>">Home</a>  / Rigths / Assignments / <?php echo Rights::t('core', 'Assignments for :username', array(
		':username'=>$model->getName()
	)); ?>
	</div>
	<div class="clearfix"></div>
</div>
<div id="userAssignments" style="width: 100%;">
	<?php 
		$this->beginWidget('zii.widgets.CPortlet', array(
			'htmlOptions'=>array(
				'class'=>''
			)
		));
		$this->widget('bootstrap.widgets.TbMenu', array(
			'type'=>'pills',
			'items'=>array(
				array('label'=>'Assignments', 'url'=>Yii::app()->controller->createUrl('assignment/view'), 'active'=>true, 'linkOptions'=>array()),
				array('label'=>'Permissions', 'url'=>Yii::app()->controller->createUrl('authItem/permissions'), 'linkOptions'=>array()),
				array('label'=>'Roles', 'url'=>Yii::app()->controller->createUrl('authItem/roles'), 'linkOptions'=>array()),
				array('label'=>'Tasks', 'url'=>Yii::app()->controller->createUrl('authItem/tasks'), 'linkOptions'=>array()),
				array('label'=>'Operations', 'url'=>Yii::app()->controller->createUrl('authItem/operations'), 'linkOptions'=>array()),
			),
		));
		$this->endWidget();
	?>
	<div class="span6" style="float: left;">

		<?php $this->widget('bootstrap.widgets.TbGridView', array(
			'dataProvider'=>$dataProvider,
			'template'=>'{items}',
			'type'=>'striped bordered condensed',
			'hideHeader'=>true,
			'emptyText'=>Rights::t('core', 'This user has not been assigned any items.'),
			'htmlOptions'=>array('class'=>'grid-view user-assignment-table mini'),
			'columns'=>array(
    			array(
    				'name'=>'name',
    				'header'=>Rights::t('core', 'Name'),
    				'type'=>'raw',
    				'htmlOptions'=>array('class'=>'name-column'),
    				'value'=>'$data->getNameText()',
    			),
    			array(
    				'name'=>'type',
    				'header'=>Rights::t('core', 'Type'),
    				'type'=>'raw',
    				'htmlOptions'=>array('class'=>'type-column'),
    				'value'=>'$data->getTypeText()',
    			),
    			array(
    				'header'=>'&nbsp;',
    				'type'=>'raw',
    				'htmlOptions'=>array('class'=>'actions-column'),
    				'value'=>'$data->getRevokeAssignmentLink()',
    			),
			)
		)); ?>

	</div>

	<div class="span6" style="float: right;">

		<h3><?php echo Rights::t('core', 'Assign item'); ?></h3>

		<?php if( $formModel!==null ): ?>

			<div class="form">

				<?php $this->renderPartial('_form', array(
					'model'=>$formModel,
					'itemnameSelectOptions'=>$assignSelectOptions,
				)); ?>

			</div>

		<?php else: ?>

			<p class="info"><?php echo Rights::t('core', 'No assignments available to be assigned to this user.'); ?>

		<?php endif; ?>

	</div>

</div>
